/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package CapaDatos;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author langeblanc
 */
@Entity
@Table(name = "parametros", catalog = "marengo", schema = "")
@NamedQueries({
    @NamedQuery(name = "Parametros.findAll", query = "SELECT p FROM Parametros p"),
    @NamedQuery(name = "Parametros.findByIdparametros", query = "SELECT p FROM Parametros p WHERE p.idparametros = :idparametros"),
    @NamedQuery(name = "Parametros.findByPHagua", query = "SELECT p FROM Parametros p WHERE p.pHagua = :pHagua"),
    @NamedQuery(name = "Parametros.findByCaudalEntrada", query = "SELECT p FROM Parametros p WHERE p.caudalEntrada = :caudalEntrada"),
    @NamedQuery(name = "Parametros.findByCaudalSalida", query = "SELECT p FROM Parametros p WHERE p.caudalSalida = :caudalSalida"),
    @NamedQuery(name = "Parametros.findByNivelTanque", query = "SELECT p FROM Parametros p WHERE p.nivelTanque = :nivelTanque")})
public class Parametros implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idparametros", nullable = false)
    private Integer idparametros;
    @Basic(optional = false)
    @Column(name = "pH_agua", nullable = false, precision = 3, scale = 2)
    private BigDecimal pHagua;
    @Basic(optional = false)
    @Column(name = "caudal_entrada", nullable = false, precision = 5, scale = 2)
    private BigDecimal caudalEntrada;
    @Basic(optional = false)
    @Column(name = "caudal_salida", nullable = false, precision = 5, scale = 2)
    private BigDecimal caudalSalida;
    @Basic(optional = false)
    @Column(name = "nivel_tanque", nullable = false, precision = 5, scale = 2)
    private BigDecimal nivelTanque;

    public Parametros() {
    }

    public Parametros(Integer idparametros) {
        this.idparametros = idparametros;
    }

    public Parametros(Integer idparametros, BigDecimal pHagua, BigDecimal caudalEntrada, BigDecimal caudalSalida, BigDecimal nivelTanque) {
        this.idparametros = idparametros;
        this.pHagua = pHagua;
        this.caudalEntrada = caudalEntrada;
        this.caudalSalida = caudalSalida;
        this.nivelTanque = nivelTanque;
    }

    public Integer getIdparametros() {
        return idparametros;
    }

    public void setIdparametros(Integer idparametros) {
        Integer oldIdparametros = this.idparametros;
        this.idparametros = idparametros;
        changeSupport.firePropertyChange("idparametros", oldIdparametros, idparametros);
    }

    public BigDecimal getPHagua() {
        return pHagua;
    }

    public void setPHagua(BigDecimal pHagua) {
        BigDecimal oldPHagua = this.pHagua;
        this.pHagua = pHagua;
        changeSupport.firePropertyChange("PHagua", oldPHagua, pHagua);
    }

    public BigDecimal getCaudalEntrada() {
        return caudalEntrada;
    }

    public void setCaudalEntrada(BigDecimal caudalEntrada) {
        BigDecimal oldCaudalEntrada = this.caudalEntrada;
        this.caudalEntrada = caudalEntrada;
        changeSupport.firePropertyChange("caudalEntrada", oldCaudalEntrada, caudalEntrada);
    }

    public BigDecimal getCaudalSalida() {
        return caudalSalida;
    }

    public void setCaudalSalida(BigDecimal caudalSalida) {
        BigDecimal oldCaudalSalida = this.caudalSalida;
        this.caudalSalida = caudalSalida;
        changeSupport.firePropertyChange("caudalSalida", oldCaudalSalida, caudalSalida);
    }

    public BigDecimal getNivelTanque() {
        return nivelTanque;
    }

    public void setNivelTanque(BigDecimal nivelTanque) {
        BigDecimal oldNivelTanque = this.nivelTanque;
        this.nivelTanque = nivelTanque;
        changeSupport.firePropertyChange("nivelTanque", oldNivelTanque, nivelTanque);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idparametros != null ? idparametros.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Parametros)) {
            return false;
        }
        Parametros other = (Parametros) object;
        if ((this.idparametros == null && other.idparametros != null) || (this.idparametros != null && !this.idparametros.equals(other.idparametros))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "CapaDatos.Parametros[idparametros=" + idparametros + "]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }

}
